package com.sheng.project.model.async;

import com.sheng.project.common.BasicEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.extern.slf4j.Slf4j;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 异步过程
 *
 * @author by ls
 * @date 2023/8/21
 */
@ApiModel("异步过程")
@Data
@ToString
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "async_process")
@Entity
@Slf4j
public class AsyncProcess extends BasicEntity {

    @ApiModelProperty("线程 ID")
    @Column(name = "thread_id", columnDefinition = "BIGINT(11) NULL COMMENT '线程 ID'")
    private Long threadId;

    @ApiModelProperty("线程名称")
    @Column(name = "thread_name", columnDefinition = "VARCHAR(50) NULL COMMENT '线程名称'")
    private String threadName;

    @ApiModelProperty("任务开始时间")
    @Column(name = "start", columnDefinition = "BIGINT(11) NULL COMMENT '任务开始时间'")
    private Long start;

    @ApiModelProperty("任务结束时间")
    @Column(name = "end", columnDefinition = "BIGINT(11) NULL COMMENT '任务结束时间'")
    private Long end;

    @ApiModelProperty("附加信息")
    @Column(name = "additional_info", columnDefinition = "VARCHAR(3000) NULL COMMENT '附加信息'")
    private String additionalInfo;

    @ApiModelProperty("执行状态")
    @Column(name = "status", columnDefinition = "VARCHAR(10) NULL COMMENT '执行状态'")
    private String status;

    @ApiModelProperty("错误信息")
    @Column(name = "err_msg", columnDefinition = "VARCHAR(255) NULL COMMENT '错误信息'")
    private String errMsg;
}
